#pragma once
#include"DecodePipeLine.h"
#include"TcpServer.h"
#include"Tools.h"
#include<qtimer.h>
#include<memory>
#include"VideoWidget.h"
class Controller
{
public:
	static Controller* GetInstance();
	bool GetQOpenGLWiget(QOpenGLWidget* p);
	void StartRendering();
	void PauseRendering();
	bool DecodeFile(char* path);
	bool DecodeNet(short port);
private:
	Controller() {};
	~Controller() {};
	std::unique_ptr<QTimer>timer_;
	static Controller* controller_p_;
	VideoWidget* opengl_widget_p_;
	std::unique_ptr<std::thread> trans_data_thread_;
};

